﻿//* Constant Variables*//
var True = "True";

//* Page Load Event *//
$(function () { 
    updateStyle();
    
});

function updateStyle() {
    $(".ui-grid-footer").find("a").each(function (i, el) { $(this).button(); });
    $(".ui-grid-content tbody").find("a").each(function (i, el) { $(this).button(); });
}


function Edit(id, name, active, postal, physical) {
    var a;
    if (active == "True") { a = true; } else {a = false; };
    $("#ClientId").attr('value', id );
//    $("#Active").attr('checked', a);
    //    $("#Active").attr('value', a);
    $("#activebox").attr('checked', a);
    $("#Active").val(a);
    $("#EditDialog").dialog({
        width: 600, height: 400, modal: true, buttons: {
            "OK": function ()
            {
                var checked = $('#activebox').attr('checked');
        $("#Active").val(checked);
        $("#Update").val(active);
        $("#ClientsForm").submit();
    }
    } });
    $("#ClientName").val(name);
    $("#Active").val(active);
    

    $("#PostalAddress").val(postal);
    $("#PhysicalAddress").val(physical);


    $(".submit").button().click(function() {
       // $("#ClientsForm").submit();
        });
   // $("#EditDialog").dialog().parent().appendTo($("form:ClientsForm"));
}